import React, { Component } from 'react';
import {
    View,
    Text,
} from 'react-native';
import styles from "./styles";
import Swiper from "react-native-swiper";
import SwiperItem from "./SwiperItem";
export default class IndexSwiper extends Component {

    constructor(props) {
        super(props);
        this.state = {
            
        };
    }
    
    render() {
        const {swiperData, navigation} = this.props
        return (
            <View
                style={styles.swiperSize}
            >
                <Swiper
                    key={swiperData.length}
                    height={styles.swiperSize.height}
                    autoplay={true}
                    loop={true}
                    activeDotColor={"#ffffff"}
                    paginationStyle={styles.paginationStyle}
                >
                    {
                        swiperData.map((item, index) => {
                          return(<SwiperItem data={item} key={item.id} navigation={navigation} styles={styles}/>)  
                        })
                    }
                </Swiper>
            </View>
        );
    }
    
}
